package com.lecture.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lecture.entity.PlantProductionInfo;
import com.lecture.entity.PlantProductionInfoParam;
import com.lecture.mapper.PlantProductionInfoMapper;
import com.lecture.service.IPlantProductionInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 全厂生产信息 服务实现类
 * </p>
 *
 * @author luyn
 * @since 2025-03-14
 */
@Service
public class PlantProductionInfoServiceImpl extends ServiceImpl<PlantProductionInfoMapper, PlantProductionInfo> implements IPlantProductionInfoService {

    @Override
    public List<PlantProductionInfo> getPlantProductionInfoList(PlantProductionInfoParam param) {
        QueryWrapper<PlantProductionInfo> queryWrapper = new QueryWrapper<>();
        /*if (Func.isNotEmpty(param.getRecordDateMin()) && Func.isNotEmpty(param.getRecordDateMax())) {
            queryWrapper.between("record_date", param.getRecordDateMin(), param.getRecordDateMax());
        } else if (Func.isNotEmpty(param.getRecordDateMin())) {
            queryWrapper.gt("record_date", param.getRecordDateMin());
        } else if (Func.isNotEmpty(param.getRecordDateMax())) {
            queryWrapper.lt("record_date", param.getRecordDateMax());
        }

        if (Func.isNotEmpty(param.getUnit1CoalConsumptionMin()) && Func.isNotEmpty(param.getUnit1CoalConsumptionMax())) {
            queryWrapper.between("unit1_coal_consumption", param.getUnit1CoalConsumptionMin(), param.getUnit1CoalConsumptionMax());
        } else if (Func.isNotEmpty(param.getUnit1CoalConsumptionMin())) {
            queryWrapper.gt("unit1_coal_consumption", param.getUnit1CoalConsumptionMin());
        } else if (Func.isNotEmpty(param.getUnit1CoalConsumptionMax())) {
            queryWrapper.lt("unit1_coal_consumption", param.getUnit1CoalConsumptionMax());
        }

        if (Func.isNotEmpty(param.getUnit2CoalConsumptionMin()) && Func.isNotEmpty(param.getUnit2CoalConsumptionMax())) {
            queryWrapper.between("unit2_coal_consumption", param.getUnit2CoalConsumptionMin(), param.getUnit2CoalConsumptionMax());
        } else if (Func.isNotEmpty(param.getUnit2CoalConsumptionMin())) {
            queryWrapper.gt("unit2_coal_consumption", param.getUnit2CoalConsumptionMin());
        } else if (Func.isNotEmpty(param.getUnit2CoalConsumptionMax())) {
            queryWrapper.lt("unit2_coal_consumption", param.getUnit2CoalConsumptionMax());
        }

        if (Func.isNotEmpty(param.getUnit3CoalConsumptionMin()) && Func.isNotEmpty(param.getUnit3CoalConsumptionMax())) {
            queryWrapper.between("unit3_coal_consumption", param.getUnit3CoalConsumptionMin(), param.getUnit3CoalConsumptionMax());
        } else if (Func.isNotEmpty(param.getUnit3CoalConsumptionMin())) {
            queryWrapper.gt("unit3_coal_consumption", param.getUnit3CoalConsumptionMin());
        } else if (Func.isNotEmpty(param.getUnit3CoalConsumptionMax())) {
            queryWrapper.lt("unit3_coal_consumption", param.getUnit3CoalConsumptionMax());
        }

        if (Func.isNotEmpty(param.getUnit4CoalConsumptionMin()) && Func.isNotEmpty(param.getUnit4CoalConsumptionMax())) {
            queryWrapper.between("unit4_coal_consumption", param.getUnit4CoalConsumptionMin(), param.getUnit4CoalConsumptionMax());
        } else if (Func.isNotEmpty(param.getUnit4CoalConsumptionMin())) {
            queryWrapper.gt("unit4_coal_consumption", param.getUnit4CoalConsumptionMin());
        } else if (Func.isNotEmpty(param.getUnit4CoalConsumptionMax())) {
            queryWrapper.lt("unit4_coal_consumption", param.getUnit4CoalConsumptionMax());
        }

        if (Func.isNotEmpty(param.getUnit5CoalConsumptionMin()) && Func.isNotEmpty(param.getUnit5CoalConsumptionMax())) {
            queryWrapper.between("unit5_coal_consumption", param.getUnit5CoalConsumptionMin(), param.getUnit5CoalConsumptionMax());
        } else if (Func.isNotEmpty(param.getUnit5CoalConsumptionMin())) {
            queryWrapper.gt("unit5_coal_consumption", param.getUnit5CoalConsumptionMin());
        } else if (Func.isNotEmpty(param.getUnit5CoalConsumptionMax())) {
            queryWrapper.lt("unit5_coal_consumption", param.getUnit5CoalConsumptionMax());
        }

        if (Func.isNotEmpty(param.getUnit6CoalConsumptionMin()) && Func.isNotEmpty(param.getUnit6CoalConsumptionMax())) {
            queryWrapper.between("unit6_coal_consumption", param.getUnit6CoalConsumptionMin(), param.getUnit6CoalConsumptionMax());
        } else if (Func.isNotEmpty(param.getUnit6CoalConsumptionMin())) {
            queryWrapper.gt("unit6_coal_consumption", param.getUnit6CoalConsumptionMin());
        } else if (Func.isNotEmpty(param.getUnit6CoalConsumptionMax())) {
            queryWrapper.lt("unit6_coal_consumption", param.getUnit6CoalConsumptionMax());
        }


        if (Func.isNotEmpty(param.getPhase1CoalConsumptionMin()) && Func.isNotEmpty(param.getPhase1CoalConsumptionMax())) {
            queryWrapper.between("phase1_coal_consumption", param.getPhase1CoalConsumptionMin(), param.getPhase1CoalConsumptionMax());
        } else if (Func.isNotEmpty(param.getPhase1CoalConsumptionMin())) {
            queryWrapper.gt("phase1_coal_consumption", param.getPhase1CoalConsumptionMin());
        } else if (Func.isNotEmpty(param.getPhase1CoalConsumptionMax())) {
            queryWrapper.lt("phase1_coal_consumption", param.getPhase1CoalConsumptionMax());
        }

        if (Func.isNotEmpty(param.getPhase2CoalConsumptionMin()) && Func.isNotEmpty(param.getPhase2CoalConsumptionMax())) {
            queryWrapper.between("phase2_coal_consumption", param.getPhase2CoalConsumptionMin(), param.getPhase2CoalConsumptionMax());
        } else if (Func.isNotEmpty(param.getPhase2CoalConsumptionMin())) {
            queryWrapper.gt("phase2_coal_consumption", param.getPhase2CoalConsumptionMin());
        } else if (Func.isNotEmpty(param.getPhase2CoalConsumptionMax())) {
            queryWrapper.lt("phase2_coal_consumption", param.getPhase2CoalConsumptionMax());
        }

        if (Func.isNotEmpty(param.getUnit1WaterSupplyMin()) && Func.isNotEmpty(param.getUnit1WaterSupplyMax())) {
            queryWrapper.between("unit1_water_supply", param.getUnit1WaterSupplyMin(), param.getUnit1WaterSupplyMax());
        } else if (Func.isNotEmpty(param.getUnit1WaterSupplyMin())) {
            queryWrapper.gt("unit1_water_supply", param.getUnit1WaterSupplyMin());
        } else if (Func.isNotEmpty(param.getUnit1WaterSupplyMax())) {
            queryWrapper.lt("unit1_water_supply", param.getUnit1WaterSupplyMax());
        }

        if (Func.isNotEmpty(param.getUnit2WaterSupplyMin()) && Func.isNotEmpty(param.getUnit2WaterSupplyMax())) {
            queryWrapper.between("unit2_water_supply", param.getUnit2WaterSupplyMin(), param.getUnit2WaterSupplyMax());
        } else if (Func.isNotEmpty(param.getUnit2WaterSupplyMin())) {
            queryWrapper.gt("unit2_water_supply", param.getUnit2WaterSupplyMin());
        } else if (Func.isNotEmpty(param.getUnit2WaterSupplyMax())) {
            queryWrapper.lt("unit2_water_supply", param.getUnit2WaterSupplyMax());
        }

        if (Func.isNotEmpty(param.getUnit3WaterSupplyMin()) && Func.isNotEmpty(param.getUnit3WaterSupplyMax())) {
            queryWrapper.between("unit3_water_supply", param.getUnit3WaterSupplyMin(), param.getUnit3WaterSupplyMax());
        } else if (Func.isNotEmpty(param.getUnit3WaterSupplyMin())) {
            queryWrapper.gt("unit3_water_supply", param.getUnit3WaterSupplyMin());
        } else if (Func.isNotEmpty(param.getUnit3WaterSupplyMax())) {
            queryWrapper.lt("unit3_water_supply", param.getUnit3WaterSupplyMax());
        }

        if (Func.isNotEmpty(param.getUnit4WaterSupplyMin()) && Func.isNotEmpty(param.getUnit4WaterSupplyMax())) {
            queryWrapper.between("unit4_water_supply", param.getUnit4WaterSupplyMin(), param.getUnit4WaterSupplyMax());
        } else if (Func.isNotEmpty(param.getUnit4WaterSupplyMin())) {
            queryWrapper.gt("unit4_water_supply", param.getUnit4WaterSupplyMin());
        } else if (Func.isNotEmpty(param.getUnit4WaterSupplyMax())) {
            queryWrapper.lt("unit4_water_supply", param.getUnit4WaterSupplyMax());
        }

        if (Func.isNotEmpty(param.getUnit5WaterSupplyMin()) && Func.isNotEmpty(param.getUnit5WaterSupplyMax())) {
            queryWrapper.between("unit5_water_supply", param.getUnit5WaterSupplyMin(), param.getUnit5WaterSupplyMax());
        } else if (Func.isNotEmpty(param.getUnit5WaterSupplyMin())) {
            queryWrapper.gt("unit5_water_supply", param.getUnit5WaterSupplyMin());
        } else if (Func.isNotEmpty(param.getUnit5WaterSupplyMax())) {
            queryWrapper.lt("unit5_water_supply", param.getUnit5WaterSupplyMax());
        }

        if (Func.isNotEmpty(param.getUnit6WaterSupplyMin()) && Func.isNotEmpty(param.getUnit6WaterSupplyMax())) {
            queryWrapper.between("unit6_water_supply", param.getUnit6WaterSupplyMin(), param.getUnit6WaterSupplyMax());
        } else if (Func.isNotEmpty(param.getUnit6WaterSupplyMin())) {
            queryWrapper.gt("unit6_water_supply", param.getUnit6WaterSupplyMin());
        } else if (Func.isNotEmpty(param.getUnit6WaterSupplyMax())) {
            queryWrapper.lt("unit6_water_supply", param.getUnit6WaterSupplyMax());
        }


        if (Func.isNotEmpty(param.getPhase1WaterSupplyMin()) && Func.isNotEmpty(param.getPhase1WaterSupplyMax())) {
            queryWrapper.between("phase1_water_supply", param.getPhase1WaterSupplyMin(), param.getPhase1WaterSupplyMax());
        } else if (Func.isNotEmpty(param.getPhase1WaterSupplyMin())) {
            queryWrapper.gt("phase1_water_supply", param.getPhase1WaterSupplyMin());
        } else if (Func.isNotEmpty(param.getPhase1WaterSupplyMax())) {
            queryWrapper.lt("phase1_water_supply", param.getPhase1WaterSupplyMax());
        }

        if (Func.isNotEmpty(param.getPhase2WaterSupplyMin()) && Func.isNotEmpty(param.getPhase2WaterSupplyMax())) {
            queryWrapper.between("phase2_water_supply", param.getPhase2WaterSupplyMin(), param.getPhase2WaterSupplyMax());
        } else if (Func.isNotEmpty(param.getPhase2WaterSupplyMin())) {
            queryWrapper.gt("phase2_water_supply", param.getPhase2WaterSupplyMin());
        } else if (Func.isNotEmpty(param.getPhase2WaterSupplyMax())) {
            queryWrapper.lt("phase2_water_supply", param.getPhase2WaterSupplyMax());
        }

        if (Func.isNotEmpty(param.getUnit1HydrogenSupplyMin()) && Func.isNotEmpty(param.getUnit1HydrogenSupplyMax())) {
            queryWrapper.between("unit1_hydrogen_supply", param.getUnit1HydrogenSupplyMin(), param.getUnit1HydrogenSupplyMax());
        } else if (Func.isNotEmpty(param.getUnit1HydrogenSupplyMin())) {
            queryWrapper.gt("unit1_hydrogen_supply", param.getUnit1HydrogenSupplyMin());
        } else if (Func.isNotEmpty(param.getUnit1HydrogenSupplyMax())) {
            queryWrapper.lt("unit1_hydrogen_supply", param.getUnit1HydrogenSupplyMax());
        }

        if (Func.isNotEmpty(param.getUnit2HydrogenSupplyMin()) && Func.isNotEmpty(param.getUnit2HydrogenSupplyMax())) {
            queryWrapper.between("unit2_hydrogen_supply", param.getUnit2HydrogenSupplyMin(), param.getUnit2HydrogenSupplyMax());
        } else if (Func.isNotEmpty(param.getUnit2HydrogenSupplyMin())) {
            queryWrapper.gt("unit2_hydrogen_supply", param.getUnit2HydrogenSupplyMin());
        } else if (Func.isNotEmpty(param.getUnit2HydrogenSupplyMax())) {
            queryWrapper.lt("unit2_hydrogen_supply", param.getUnit2HydrogenSupplyMax());
        }

        if (Func.isNotEmpty(param.getUnit3HydrogenSupplyMin()) && Func.isNotEmpty(param.getUnit3HydrogenSupplyMax())) {
            queryWrapper.between("unit3_hydrogen_supply", param.getUnit3HydrogenSupplyMin(), param.getUnit3HydrogenSupplyMax());
        } else if (Func.isNotEmpty(param.getUnit3HydrogenSupplyMin())) {
            queryWrapper.gt("unit3_hydrogen_supply", param.getUnit3HydrogenSupplyMin());
        } else if (Func.isNotEmpty(param.getUnit3HydrogenSupplyMax())) {
            queryWrapper.lt("unit3_hydrogen_supply", param.getUnit3HydrogenSupplyMax());
        }

        if (Func.isNotEmpty(param.getUnit4HydrogenSupplyMin()) && Func.isNotEmpty(param.getUnit4HydrogenSupplyMax())) {
            queryWrapper.between("unit4_hydrogen_supply", param.getUnit4HydrogenSupplyMin(), param.getUnit4HydrogenSupplyMax());
        } else if (Func.isNotEmpty(param.getUnit4HydrogenSupplyMin())) {
            queryWrapper.gt("unit4_hydrogen_supply", param.getUnit4HydrogenSupplyMin());
        } else if (Func.isNotEmpty(param.getUnit4HydrogenSupplyMax())) {
            queryWrapper.lt("unit4_hydrogen_supply", param.getUnit4HydrogenSupplyMax());
        }

        if (Func.isNotEmpty(param.getUnit5HydrogenSupplyMin()) && Func.isNotEmpty(param.getUnit5HydrogenSupplyMax())) {
            queryWrapper.between("unit5_hydrogen_supply", param.getUnit5HydrogenSupplyMin(), param.getUnit5HydrogenSupplyMax());
        } else if (Func.isNotEmpty(param.getUnit5HydrogenSupplyMin())) {
            queryWrapper.gt("unit5_hydrogen_supply", param.getUnit5HydrogenSupplyMin());
        } else if (Func.isNotEmpty(param.getUnit5HydrogenSupplyMax())) {
            queryWrapper.lt("unit5_hydrogen_supply", param.getUnit5HydrogenSupplyMax());
        }

        if (Func.isNotEmpty(param.getUnit6HydrogenSupplyMin()) && Func.isNotEmpty(param.getUnit6HydrogenSupplyMax())) {
            queryWrapper.between("unit6_hydrogen_supply", param.getUnit6HydrogenSupplyMin(), param.getUnit6HydrogenSupplyMax());
        } else if (Func.isNotEmpty(param.getUnit6HydrogenSupplyMin())) {
            queryWrapper.gt("unit6_hydrogen_supply", param.getUnit6HydrogenSupplyMin());
        } else if (Func.isNotEmpty(param.getUnit6HydrogenSupplyMax())) {
            queryWrapper.lt("unit6_hydrogen_supply", param.getUnit6HydrogenSupplyMax());
        }

        if (Func.isNotEmpty(param.getPhase1HydrogenSupplyMin()) && Func.isNotEmpty(param.getPhase1HydrogenSupplyMax())) {
            queryWrapper.between("phase1_hydrogen_supply", param.getPhase1HydrogenSupplyMin(), param.getPhase1HydrogenSupplyMax());
        } else if (Func.isNotEmpty(param.getPhase1HydrogenSupplyMin())) {
            queryWrapper.gt("phase1_hydrogen_supply", param.getPhase1HydrogenSupplyMin());
        } else if (Func.isNotEmpty(param.getPhase1HydrogenSupplyMax())) {
            queryWrapper.lt("phase1_hydrogen_supply", param.getPhase1HydrogenSupplyMax());
        }


        if (Func.isNotEmpty(param.getPhase2HydrogenSupplyMin()) && Func.isNotEmpty(param.getPhase2HydrogenSupplyMax())) {
            queryWrapper.between("phase2_hydrogen_supply", param.getPhase2HydrogenSupplyMin(), param.getPhase2HydrogenSupplyMax());
        } else if (Func.isNotEmpty(param.getPhase2HydrogenSupplyMin())) {
            queryWrapper.ge("phase2_hydrogen_supply", param.getPhase2HydrogenSupplyMin());
        } else if (Func.isNotEmpty(param.getPhase2HydrogenSupplyMax())) {
            queryWrapper.le("phase2_hydrogen_supply", param.getPhase2HydrogenSupplyMax());
        }

        if (Func.isNotEmpty(param.getUnit1PowerUsageRateMin()) && Func.isNotEmpty(param.getUnit1PowerUsageRateMax())) {
            queryWrapper.between("unit1_power_usage_rate", param.getUnit1PowerUsageRateMin(), param.getUnit1PowerUsageRateMax());
        } else if (Func.isNotEmpty(param.getUnit1PowerUsageRateMin())) {
            queryWrapper.ge("unit1_power_usage_rate", param.getUnit1PowerUsageRateMin());
        } else if (Func.isNotEmpty(param.getUnit1PowerUsageRateMax())) {
            queryWrapper.le("unit1_power_usage_rate", param.getUnit1PowerUsageRateMax());
        }

        if (Func.isNotEmpty(param.getUnit2PowerUsageRateMin()) && Func.isNotEmpty(param.getUnit2PowerUsageRateMax())) {
            queryWrapper.between("unit2_power_usage_rate", param.getUnit2PowerUsageRateMin(), param.getUnit2PowerUsageRateMax());
        } else if (Func.isNotEmpty(param.getUnit2PowerUsageRateMin())) {
            queryWrapper.ge("unit2_power_usage_rate", param.getUnit2PowerUsageRateMin());
        } else if (Func.isNotEmpty(param.getUnit2PowerUsageRateMax())) {
            queryWrapper.le("unit2_power_usage_rate", param.getUnit2PowerUsageRateMax());
        }

        if (Func.isNotEmpty(param.getUnit3PowerUsageRateMin()) && Func.isNotEmpty(param.getUnit3PowerUsageRateMax())) {
            queryWrapper.between("unit3_power_usage_rate", param.getUnit3PowerUsageRateMin(), param.getUnit3PowerUsageRateMax());
        } else if (Func.isNotEmpty(param.getUnit3PowerUsageRateMin())) {
            queryWrapper.ge("unit3_power_usage_rate", param.getUnit3PowerUsageRateMin());
        } else if (Func.isNotEmpty(param.getUnit3PowerUsageRateMax())) {
            queryWrapper.le("unit3_power_usage_rate", param.getUnit3PowerUsageRateMax());
        }

        if (Func.isNotEmpty(param.getUnit4PowerUsageRateMin()) && Func.isNotEmpty(param.getUnit4PowerUsageRateMax())) {
            queryWrapper.between("unit4_power_usage_rate", param.getUnit4PowerUsageRateMin(), param.getUnit4PowerUsageRateMax());
        } else if (Func.isNotEmpty(param.getUnit4PowerUsageRateMin())) {
            queryWrapper.ge("unit4_power_usage_rate", param.getUnit4PowerUsageRateMin());
        } else if (Func.isNotEmpty(param.getUnit4PowerUsageRateMax())) {
            queryWrapper.le("unit4_power_usage_rate", param.getUnit4PowerUsageRateMax());
        }

        if (Func.isNotEmpty(param.getUnit5PowerUsageRateMin()) && Func.isNotEmpty(param.getUnit5PowerUsageRateMax())) {
            queryWrapper.between("unit5_power_usage_rate", param.getUnit5PowerUsageRateMin(), param.getUnit5PowerUsageRateMax());
        } else if (Func.isNotEmpty(param.getUnit5PowerUsageRateMin())) {
            queryWrapper.ge("unit5_power_usage_rate", param.getUnit5PowerUsageRateMin());
        } else if (Func.isNotEmpty(param.getUnit5PowerUsageRateMax())) {
            queryWrapper.le("unit5_power_usage_rate", param.getUnit5PowerUsageRateMax());
        }

        if (Func.isNotEmpty(param.getUnit6PowerUsageRateMin()) && Func.isNotEmpty(param.getUnit6PowerUsageRateMax())) {
            queryWrapper.between("unit6_power_usage_rate", param.getUnit6PowerUsageRateMin(), param.getUnit6PowerUsageRateMax());
        } else if (Func.isNotEmpty(param.getUnit6PowerUsageRateMin())) {
            queryWrapper.ge("unit6_power_usage_rate", param.getUnit6PowerUsageRateMin());
        } else if (Func.isNotEmpty(param.getUnit6PowerUsageRateMax())) {
            queryWrapper.le("unit6_power_usage_rate", param.getUnit6PowerUsageRateMax());
        }

        if (Func.isNotEmpty(param.getPhase1PowerUsageRateMin()) && Func.isNotEmpty(param.getPhase1PowerUsageRateMax())) {
            queryWrapper.between("phase1_power_usage_rate", param.getPhase1PowerUsageRateMin(), param.getPhase1PowerUsageRateMax());
        } else if (Func.isNotEmpty(param.getPhase1PowerUsageRateMin())) {
            queryWrapper.ge("phase1_power_usage_rate", param.getPhase1PowerUsageRateMin());
        } else if (Func.isNotEmpty(param.getPhase1PowerUsageRateMax())) {
            queryWrapper.le("phase1_power_usage_rate", param.getPhase1PowerUsageRateMax());
        }

        if (Func.isNotEmpty(param.getPhase2PowerUsageRateMin()) && Func.isNotEmpty(param.getPhase2PowerUsageRateMax())) {
            queryWrapper.between("phase2_power_usage_rate", param.getPhase2PowerUsageRateMin(), param.getPhase2PowerUsageRateMax());
        } else if (Func.isNotEmpty(param.getPhase2PowerUsageRateMin())) {
            queryWrapper.ge("phase2_power_usage_rate", param.getPhase2PowerUsageRateMin());
        } else if (Func.isNotEmpty(param.getPhase2PowerUsageRateMax())) {
            queryWrapper.le("phase2_power_usage_rate", param.getPhase2PowerUsageRateMax());
        }

        if (Func.isNotEmpty(param.getUnit1SmokeMin()) && Func.isNotEmpty(param.getUnit1SmokeMax())) {
            queryWrapper.between("unit1_smoke", param.getUnit1SmokeMin(), param.getUnit1SmokeMax());
        } else if (Func.isNotEmpty(param.getUnit1SmokeMin())) {
            queryWrapper.ge("unit1_smoke", param.getUnit1SmokeMin());
        } else if (Func.isNotEmpty(param.getUnit1SmokeMax())) {
            queryWrapper.le("unit1_smoke", param.getUnit1SmokeMax());
        }

        if (Func.isNotEmpty(param.getUnit2SmokeMin()) && Func.isNotEmpty(param.getUnit2SmokeMax())) {
            queryWrapper.between("unit2_smoke", param.getUnit2SmokeMin(), param.getUnit2SmokeMax());
        } else if (Func.isNotEmpty(param.getUnit2SmokeMin())) {
            queryWrapper.ge("unit2_smoke", param.getUnit2SmokeMin());
        } else if (Func.isNotEmpty(param.getUnit2SmokeMax())) {
            queryWrapper.le("unit2_smoke", param.getUnit2SmokeMax());
        }

        if (Func.isNotEmpty(param.getUnit3SmokeMin()) && Func.isNotEmpty(param.getUnit3SmokeMax())) {
            queryWrapper.between("unit3_smoke", param.getUnit3SmokeMin(), param.getUnit3SmokeMax());
        } else if (Func.isNotEmpty(param.getUnit3SmokeMin())) {
            queryWrapper.ge("unit3_smoke", param.getUnit3SmokeMin());
        } else if (Func.isNotEmpty(param.getUnit3SmokeMax())) {
            queryWrapper.le("unit3_smoke", param.getUnit3SmokeMax());
        }


        if (Func.isNotEmpty(param.getUnit4SmokeMin()) && Func.isNotEmpty(param.getUnit4SmokeMax())) {
            queryWrapper.between("unit4_smoke", param.getUnit4SmokeMin(), param.getUnit4SmokeMax());
        } else if (Func.isNotEmpty(param.getUnit4SmokeMin())) {
            queryWrapper.ge("unit4_smoke", param.getUnit4SmokeMin());
        } else if (Func.isNotEmpty(param.getUnit4SmokeMax())) {
            queryWrapper.le("unit4_smoke", param.getUnit4SmokeMax());
        }

        if (Func.isNotEmpty(param.getUnit5SmokeMin()) && Func.isNotEmpty(param.getUnit5SmokeMax())) {
            queryWrapper.between("unit5_smoke", param.getUnit5SmokeMin(), param.getUnit5SmokeMax());
        } else if (Func.isNotEmpty(param.getUnit5SmokeMin())) {
            queryWrapper.ge("unit5_smoke", param.getUnit5SmokeMin());
        } else if (Func.isNotEmpty(param.getUnit5SmokeMax())) {
            queryWrapper.le("unit5_smoke", param.getUnit5SmokeMax());
        }

        if (Func.isNotEmpty(param.getUnit6SmokeMin()) && Func.isNotEmpty(param.getUnit6SmokeMax())) {
            queryWrapper.between("unit6_smoke", param.getUnit6SmokeMin(), param.getUnit6SmokeMax());
        } else if (Func.isNotEmpty(param.getUnit6SmokeMin())) {
            queryWrapper.ge("unit6_smoke", param.getUnit6SmokeMin());
        } else if (Func.isNotEmpty(param.getUnit6SmokeMax())) {
            queryWrapper.le("unit6_smoke", param.getUnit6SmokeMax());
        }

        if (Func.isNotEmpty(param.getPhase1SmokeMin()) && Func.isNotEmpty(param.getPhase1SmokeMax())) {
            queryWrapper.between("phase1_smoke", param.getPhase1SmokeMin(), param.getPhase1SmokeMax());
        } else if (Func.isNotEmpty(param.getPhase1SmokeMin())) {
            queryWrapper.ge("phase1_smoke", param.getPhase1SmokeMin());
        } else if (Func.isNotEmpty(param.getPhase1SmokeMax())) {
            queryWrapper.le("phase1_smoke", param.getPhase1SmokeMax());
        }

        if (Func.isNotEmpty(param.getPhase2SmokeMin()) && Func.isNotEmpty(param.getPhase2SmokeMax())) {
            queryWrapper.between("phase2_smoke", param.getPhase2SmokeMin(), param.getPhase2SmokeMax());
        } else if (Func.isNotEmpty(param.getPhase2SmokeMin())) {
            queryWrapper.ge("phase2_smoke", param.getPhase2SmokeMin());
        } else if (Func.isNotEmpty(param.getPhase2SmokeMax())) {
            queryWrapper.le("phase2_smoke", param.getPhase2SmokeMax());
        }

        if (Func.isNotEmpty(param.getUnit1So2Min()) && Func.isNotEmpty(param.getUnit1So2Max())) {
            queryWrapper.between("unit1_so2", param.getUnit1So2Min(), param.getUnit1So2Max());
        } else if (Func.isNotEmpty(param.getUnit1So2Min())) {
            queryWrapper.ge("unit1_so2", param.getUnit1So2Min());
        } else if (Func.isNotEmpty(param.getUnit1So2Max())) {
            queryWrapper.le("unit1_so2", param.getUnit1So2Max());
        }

        if (Func.isNotEmpty(param.getUnit2So2Min()) && Func.isNotEmpty(param.getUnit2So2Max())) {
            queryWrapper.between("unit2_so2", param.getUnit2So2Min(), param.getUnit2So2Max());
        } else if (Func.isNotEmpty(param.getUnit2So2Min())) {
            queryWrapper.ge("unit2_so2", param.getUnit2So2Min());
        } else if (Func.isNotEmpty(param.getUnit2So2Max())) {
            queryWrapper.le("unit2_so2", param.getUnit2So2Max());
        }

        if (Func.isNotEmpty(param.getUnit3So2Min()) && Func.isNotEmpty(param.getUnit3So2Max())) {
            queryWrapper.between("unit3_so2", param.getUnit3So2Min(), param.getUnit3So2Max());
        } else if (Func.isNotEmpty(param.getUnit3So2Min())) {
            queryWrapper.ge("unit3_so2", param.getUnit3So2Min());
        } else if (Func.isNotEmpty(param.getUnit3So2Max())) {
            queryWrapper.le("unit3_so2", param.getUnit3So2Max());
        }

        if (Func.isNotEmpty(param.getUnit4So2Min()) && Func.isNotEmpty(param.getUnit4So2Max())) {
            queryWrapper.between("unit4_so2", param.getUnit4So2Min(), param.getUnit4So2Max());
        } else if (Func.isNotEmpty(param.getUnit4So2Min())) {
            queryWrapper.ge("unit4_so2", param.getUnit4So2Min());
        } else if (Func.isNotEmpty(param.getUnit4So2Max())) {
            queryWrapper.le("unit4_so2", param.getUnit4So2Max());
        }

        if (Func.isNotEmpty(param.getUnit5So2Min()) && Func.isNotEmpty(param.getUnit5So2Max())) {
            queryWrapper.between("unit5_so2", param.getUnit5So2Min(), param.getUnit5So2Max());
        } else if (Func.isNotEmpty(param.getUnit5So2Min())) {
            queryWrapper.ge("unit5_so2", param.getUnit5So2Min());
        } else if (Func.isNotEmpty(param.getUnit5So2Max())) {
            queryWrapper.le("unit5_so2", param.getUnit5So2Max());
        }

        if (Func.isNotEmpty(param.getUnit6So2Min()) && Func.isNotEmpty(param.getUnit6So2Max())) {
            queryWrapper.between("unit6_so2", param.getUnit6So2Min(), param.getUnit6So2Max());
        } else if (Func.isNotEmpty(param.getUnit6So2Min())) {
            queryWrapper.ge("unit6_so2", param.getUnit6So2Min());
        } else if (Func.isNotEmpty(param.getUnit6So2Max())) {
            queryWrapper.le("unit6_so2", param.getUnit6So2Max());
        }

        if (Func.isNotEmpty(param.getPhase1So2Min()) && Func.isNotEmpty(param.getPhase1So2Max())) {
            queryWrapper.between("phase1_so2", param.getPhase1So2Min(), param.getPhase1So2Max());
        } else if (Func.isNotEmpty(param.getPhase1So2Min())) {
            queryWrapper.ge("phase1_so2", param.getPhase1So2Min());
        } else if (Func.isNotEmpty(param.getPhase1So2Max())) {
            queryWrapper.le("phase1_so2", param.getPhase1So2Max());
        }

        if (Func.isNotEmpty(param.getPhase2So2Min()) && Func.isNotEmpty(param.getPhase2So2Max())) {
            queryWrapper.between("phase2_so2", param.getPhase2So2Min(), param.getPhase2So2Max());
        } else if (Func.isNotEmpty(param.getPhase2So2Min())) {
            queryWrapper.ge("phase2_so2", param.getPhase2So2Min());
        } else if (Func.isNotEmpty(param.getPhase2So2Max())) {
            queryWrapper.le("phase2_so2", param.getPhase2So2Max());
        }

        if (Func.isNotEmpty(param.getUnit1NoxMin()) && Func.isNotEmpty(param.getUnit1NoxMax())) {
            queryWrapper.between("unit1_nox", param.getUnit1NoxMin(), param.getUnit1NoxMax());
        } else if (Func.isNotEmpty(param.getUnit1NoxMin())) {
            queryWrapper.ge("unit1_nox", param.getUnit1NoxMin());
        } else if (Func.isNotEmpty(param.getUnit1NoxMax())) {
            queryWrapper.le("unit1_nox", param.getUnit1NoxMax());
        }


        // For Unit 2 NOx
        if (Func.isNotEmpty(param.getUnit2NoxMin()) && Func.isNotEmpty(param.getUnit2NoxMax())) {
            queryWrapper.between("unit2_nox", param.getUnit2NoxMin(), param.getUnit2NoxMax());
        } else if (Func.isNotEmpty(param.getUnit2NoxMin())) {
            queryWrapper.ge("unit2_nox", param.getUnit2NoxMin());
        } else if (Func.isNotEmpty(param.getUnit2NoxMax())) {
            queryWrapper.le("unit2_nox", param.getUnit2NoxMax());
        }

// For Unit 3 NOx
        if (Func.isNotEmpty(param.getUnit3NoxMin()) && Func.isNotEmpty(param.getUnit3NoxMax())) {
            queryWrapper.between("unit3_nox", param.getUnit3NoxMin(), param.getUnit3NoxMax());
        } else if (Func.isNotEmpty(param.getUnit3NoxMin())) {
            queryWrapper.ge("unit3_nox", param.getUnit3NoxMin());
        } else if (Func.isNotEmpty(param.getUnit3NoxMax())) {
            queryWrapper.le("unit3_nox", param.getUnit3NoxMax());
        }

// For Unit 4 NOx
        if (Func.isNotEmpty(param.getUnit4NoxMin()) && Func.isNotEmpty(param.getUnit4NoxMax())) {
            queryWrapper.between("unit4_nox", param.getUnit4NoxMin(), param.getUnit4NoxMax());
        } else if (Func.isNotEmpty(param.getUnit4NoxMin())) {
            queryWrapper.ge("unit4_nox", param.getUnit4NoxMin());
        } else if (Func.isNotEmpty(param.getUnit4NoxMax())) {
            queryWrapper.le("unit4_nox", param.getUnit4NoxMax());
        }

// For Unit 5 NOx
        if (Func.isNotEmpty(param.getUnit5NoxMin()) && Func.isNotEmpty(param.getUnit5NoxMax())) {
            queryWrapper.between("unit5_nox", param.getUnit5NoxMin(), param.getUnit5NoxMax());
        } else if (Func.isNotEmpty(param.getUnit5NoxMin())) {
            queryWrapper.ge("unit5_nox", param.getUnit5NoxMin());
        } else if (Func.isNotEmpty(param.getUnit5NoxMax())) {
            queryWrapper.le("unit5_nox", param.getUnit5NoxMax());
        }

// For Unit 6 NOx
        if (Func.isNotEmpty(param.getUnit6NoxMin()) && Func.isNotEmpty(param.getUnit6NoxMax())) {
            queryWrapper.between("unit6_nox", param.getUnit6NoxMin(), param.getUnit6NoxMax());
        } else if (Func.isNotEmpty(param.getUnit6NoxMin())) {
            queryWrapper.ge("unit6_nox", param.getUnit6NoxMin());
        } else if (Func.isNotEmpty(param.getUnit6NoxMax())) {
            queryWrapper.le("unit6_nox", param.getUnit6NoxMax());
        }

// For Phase 1 NOx
        if (Func.isNotEmpty(param.getPhase1NoxMin()) && Func.isNotEmpty(param.getPhase1NoxMax())) {
            queryWrapper.between("phase1_nox", param.getPhase1NoxMin(), param.getPhase1NoxMax());
        } else if (Func.isNotEmpty(param.getPhase1NoxMin())) {
            queryWrapper.ge("phase1_nox", param.getPhase1NoxMin());
        } else if (Func.isNotEmpty(param.getPhase1NoxMax())) {
            queryWrapper.le("phase1_nox", param.getPhase1NoxMax());
        }

// For Phase 2 NOx
        if (Func.isNotEmpty(param.getPhase2NoxMin()) && Func.isNotEmpty(param.getPhase2NoxMax())) {
            queryWrapper.between("phase2_nox", param.getPhase2NoxMin(), param.getPhase2NoxMax());
        } else if (Func.isNotEmpty(param.getPhase2NoxMin())) {
            queryWrapper.ge("phase2_nox", param.getPhase2NoxMin());
        } else if (Func.isNotEmpty(param.getPhase2NoxMax())) {
            queryWrapper.le("phase2_nox", param.getPhase2NoxMax());
        }


        // For Phase 1 Coal Storage
        if (Func.isNotEmpty(param.getPhase1CoalStorageMin()) && Func.isNotEmpty(param.getPhase1CoalStorageMax())) {
            queryWrapper.between("phase1_coal_storage", param.getPhase1CoalStorageMin(), param.getPhase1CoalStorageMax());
        } else if (Func.isNotEmpty(param.getPhase1CoalStorageMin())) {
            queryWrapper.ge("phase1_coal_storage", param.getPhase1CoalStorageMin());
        } else if (Func.isNotEmpty(param.getPhase1CoalStorageMax())) {
            queryWrapper.le("phase1_coal_storage", param.getPhase1CoalStorageMax());
        }

// For Phase 1 Oil Storage
        if (Func.isNotEmpty(param.getPhase1OilStorageMin()) && Func.isNotEmpty(param.getPhase1OilStorageMax())) {
            queryWrapper.between("phase1_oil_storage", param.getPhase1OilStorageMin(), param.getPhase1OilStorageMax());
        } else if (Func.isNotEmpty(param.getPhase1OilStorageMin())) {
            queryWrapper.ge("phase1_oil_storage", param.getPhase1OilStorageMin());
        } else if (Func.isNotEmpty(param.getPhase1OilStorageMax())) {
            queryWrapper.le("phase1_oil_storage", param.getPhase1OilStorageMax());
        }

// For Phase 1 Online Power
        if (Func.isNotEmpty(param.getPhase1OnlinePowerMin()) && Func.isNotEmpty(param.getPhase1OnlinePowerMax())) {
            queryWrapper.between("phase1_online_power", param.getPhase1OnlinePowerMin(), param.getPhase1OnlinePowerMax());
        } else if (Func.isNotEmpty(param.getPhase1OnlinePowerMin())) {
            queryWrapper.ge("phase1_online_power", param.getPhase1OnlinePowerMin());
        } else if (Func.isNotEmpty(param.getPhase1OnlinePowerMax())) {
            queryWrapper.le("phase1_online_power", param.getPhase1OnlinePowerMax());
        }

// For Phase 1 Generated Power
        if (Func.isNotEmpty(param.getPhase1GeneratedPowerMin()) && Func.isNotEmpty(param.getPhase1GeneratedPowerMax())) {
            queryWrapper.between("phase1_generated_power", param.getPhase1GeneratedPowerMin(), param.getPhase1GeneratedPowerMax());
        } else if (Func.isNotEmpty(param.getPhase1GeneratedPowerMin())) {
            queryWrapper.ge("phase1_generated_power", param.getPhase1GeneratedPowerMin());
        } else if (Func.isNotEmpty(param.getPhase1GeneratedPowerMax())) {
            queryWrapper.le("phase1_generated_power", param.getPhase1GeneratedPowerMax());
        }

// For Phase 1 PV Power
        if (Func.isNotEmpty(param.getPhase1PvPowerMin()) && Func.isNotEmpty(param.getPhase1PvPowerMax())) {
            queryWrapper.between("phase1_pv_power", param.getPhase1PvPowerMin(), param.getPhase1PvPowerMax());
        } else if (Func.isNotEmpty(param.getPhase1PvPowerMin())) {
            queryWrapper.ge("phase1_pv_power", param.getPhase1PvPowerMin());
        } else if (Func.isNotEmpty(param.getPhase1PvPowerMax())) {
            queryWrapper.le("phase1_pv_power", param.getPhase1PvPowerMax());
        }

// For Phase 2 Coal Storage
        if (Func.isNotEmpty(param.getPhase2CoalStorageMin()) && Func.isNotEmpty(param.getPhase2CoalStorageMax())) {
            queryWrapper.between("phase2_coal_storage", param.getPhase2CoalStorageMin(), param.getPhase2CoalStorageMax());
        } else if (Func.isNotEmpty(param.getPhase2CoalStorageMin())) {
            queryWrapper.ge("phase2_coal_storage", param.getPhase2CoalStorageMin());
        } else if (Func.isNotEmpty(param.getPhase2CoalStorageMax())) {
            queryWrapper.le("phase2_coal_storage", param.getPhase2CoalStorageMax());
        }

// For Phase 2 Oil Storage
        if (Func.isNotEmpty(param.getPhase2OilStorageMin()) && Func.isNotEmpty(param.getPhase2OilStorageMax())) {
            queryWrapper.between("phase2_oil_storage", param.getPhase2OilStorageMin(), param.getPhase2OilStorageMax());
        } else if (Func.isNotEmpty(param.getPhase2OilStorageMin())) {
            queryWrapper.ge("phase2_oil_storage", param.getPhase2OilStorageMin());
        } else if (Func.isNotEmpty(param.getPhase2OilStorageMax())) {
            queryWrapper.le("phase2_oil_storage", param.getPhase2OilStorageMax());
        }

// For Phase 2 Online Power
        if (Func.isNotEmpty(param.getPhase2OnlinePowerMin()) && Func.isNotEmpty(param.getPhase2OnlinePowerMax())) {
            queryWrapper.between("phase2_online_power", param.getPhase2OnlinePowerMin(), param.getPhase2OnlinePowerMax());
        } else if (Func.isNotEmpty(param.getPhase2OnlinePowerMin())) {
            queryWrapper.ge("phase2_online_power", param.getPhase2OnlinePowerMin());
        } else if (Func.isNotEmpty(param.getPhase2OnlinePowerMax())) {
            queryWrapper.le("phase2_online_power", param.getPhase2OnlinePowerMax());
        }

// For Phase 2 Generated Power
        if (Func.isNotEmpty(param.getPhase2GeneratedPowerMin()) && Func.isNotEmpty(param.getPhase2GeneratedPowerMax())) {
            queryWrapper.between("phase2_generated_power", param.getPhase2GeneratedPowerMin(), param.getPhase2GeneratedPowerMax());
        } else if (Func.isNotEmpty(param.getPhase2GeneratedPowerMin())) {
            queryWrapper.ge("phase2_generated_power", param.getPhase2GeneratedPowerMin());
        } else if (Func.isNotEmpty(param.getPhase2GeneratedPowerMax())) {
            queryWrapper.le("phase2_generated_power", param.getPhase2GeneratedPowerMax());
        }

// For Phase 2 PV Power
        if (Func.isNotEmpty(param.getPhase2PvPowerMin()) && Func.isNotEmpty(param.getPhase2PvPowerMax())) {
            queryWrapper.between("phase2_pv_power", param.getPhase2PvPowerMin(), param.getPhase2PvPowerMax());
        } else if (Func.isNotEmpty(param.getPhase2PvPowerMin())) {
            queryWrapper.ge("phase2_pv_power", param.getPhase2PvPowerMin());
        } else if (Func.isNotEmpty(param.getPhase2PvPowerMax())) {
            queryWrapper.le("phase2_pv_power", param.getPhase2PvPowerMax());
        }*/

        return list(queryWrapper);
    }
}
